package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.InvWarehouseMapper;
import com.ruoyi.system.domain.InvWarehouse;
import com.ruoyi.system.service.IInvWarehouseService;

/**
 * 仓库档案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
@Service
public class InvWarehouseServiceImpl implements IInvWarehouseService 
{
    @Autowired
    private InvWarehouseMapper invWarehouseMapper;

    /**
     * 查询仓库档案
     * 
     * @param warehouseId 仓库档案主键
     * @return 仓库档案
     */
    @Override
    public InvWarehouse selectInvWarehouseByWarehouseId(Long warehouseId)
    {
        return invWarehouseMapper.selectInvWarehouseByWarehouseId(warehouseId);
    }

    /**
     * 查询仓库档案列表
     * 
     * @param invWarehouse 仓库档案
     * @return 仓库档案
     */
    @Override
    public List<InvWarehouse> selectInvWarehouseList(InvWarehouse invWarehouse)
    {
        return invWarehouseMapper.selectInvWarehouseList(invWarehouse);
    }

    /**
     * 新增仓库档案
     * 
     * @param invWarehouse 仓库档案
     * @return 结果
     */
    @Override
    public int insertInvWarehouse(InvWarehouse invWarehouse)
    {
        invWarehouse.setCreateTime(DateUtils.getNowDate());
        return invWarehouseMapper.insertInvWarehouse(invWarehouse);
    }

    /**
     * 修改仓库档案
     * 
     * @param invWarehouse 仓库档案
     * @return 结果
     */
    @Override
    public int updateInvWarehouse(InvWarehouse invWarehouse)
    {
        invWarehouse.setUpdateTime(DateUtils.getNowDate());
        return invWarehouseMapper.updateInvWarehouse(invWarehouse);
    }

    /**
     * 批量删除仓库档案
     * 
     * @param warehouseIds 需要删除的仓库档案主键
     * @return 结果
     */
    @Override
    public int deleteInvWarehouseByWarehouseIds(Long[] warehouseIds)
    {
        return invWarehouseMapper.deleteInvWarehouseByWarehouseIds(warehouseIds);
    }

    /**
     * 删除仓库档案信息
     * 
     * @param warehouseId 仓库档案主键
     * @return 结果
     */
    @Override
    public int deleteInvWarehouseByWarehouseId(Long warehouseId)
    {
        return invWarehouseMapper.deleteInvWarehouseByWarehouseId(warehouseId);
    }
}
